This application will go through a folder full of .c, .cp or .cpp sources, and extract all C string literals (including “\P” pascal-style ones) and replace them with calls that read the strings in from resources.
The code makes some assumptions about what C programs look like; don’t handle strings outside of functions well and does not know anything about the preprocessor (except to ignore lines starting with #) It generates Rez source that you can compile using MPW or Think C Rez.
Due to an unfortunate design decision, MPW in its infinite wisdom doesn’t treat \r and \n like the rest of the world; if you do this on MPW source you should re-compile the program (source is included) The actual program that goes with the source ran on itself before I built it, by the way, but that’s the amount of testing this thing has gotten so far. (Unfortunately I lost the original, tested version)
There is an initialization call in the “library” file (which you will have to add to your program) to make it read in all strings; this is good for performance, PowerBooks (which can spin down the disk) or programs that keep references to string literals around. A bonus is that you save up tons of global data space, and reading in all strings will not take up more space than having it as global/static data.
A newer version might use the ID embedded at the bottom of the source file for further processing of the same source file; for now, make sure that each file is always processed once and that IDs are contiguous.
Good luck; I can be reached as h+@nada.kth.se or AppleLink SW1226.